package com.whatech.mall.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * API网关配置Controller。
 */
@RestController
@RequestMapping("/config")
@Slf4j
// 开启动态刷新配置
@RefreshScope
public class ConfigController {

    @Value("${architecture.author}")
    private String author;

    @GetMapping("/author")
    public String getAuthor() {
        return "GlobalSharedConfig[architecture.author]: " + author;
    }

}
